//package com.budgetme.activities;
//
//import com.budgetme.R;
//import com.budgetme.R.id;
//import com.budgetme.R.layout;
//import com.budgetme.activities.fragments.ExpenseListFragment;
//import com.budgetme.database.Provider;
//import com.budgetme.widgets.BudgetWidget;
//import com.budgetme.widgets.BudgetWidgetConfigure;
//
//import android.app.Activity;
//import android.appwidget.AppWidgetManager;
//import android.content.ComponentName;
//import android.content.Intent;
//import android.content.SharedPreferences;
//import android.os.Bundle;
//import android.util.Log;
//import android.view.View;
//import android.view.View.OnClickListener;
//import android.view.View.OnLayoutChangeListener;
//import android.widget.Button;
//import android.widget.RemoteViews;
//
//
//public class Dashboard extends Activity implements OnClickListener, OnLayoutChangeListener {
//	private static final String TAG = Dashboard.class.getName();
//	
//	private Button mButtonIncome;
//	private Button mButtonExpenses;
//	private Button mButtonBills;
//	private Button mButtonBuckets;
//	private Button mButtonReset;
//	private Button mButtonBlank;
//	
//    @Override
//    public void onCreate(Bundle savedInstanceState) {
//        super.onCreate(savedInstanceState);
//        Log.d(TAG, "onCreate");
//
//        setContentView(R.layout.dashboard);
//        
//    	mButtonIncome = (Button) findViewById(R.id.dashboard_income);
//    	mButtonBills = (Button) findViewById(R.id.dashboard_bills);
//    	mButtonExpenses = (Button) findViewById(R.id.dashboard_expenses);
//    	mButtonBuckets = (Button) findViewById(R.id.dashboard_budgets);
//    	mButtonReset = (Button) findViewById(R.id.dashboard_reset);
//    	mButtonBlank = (Button) findViewById(R.id.dashboard_blank);
//        
//        mButtonIncome.setOnClickListener(this);
//        mButtonBills.setOnClickListener(this);
//    	mButtonExpenses.setOnClickListener(this);
//    	mButtonBuckets.setOnClickListener(this);
//    	mButtonReset.setOnClickListener(this);
//    	mButtonBlank.setOnClickListener(this);
//    	
//    	mButtonIncome.addOnLayoutChangeListener(this);
//    	mButtonBills.addOnLayoutChangeListener(this);
//    	mButtonExpenses.addOnLayoutChangeListener(this);
//    	mButtonBuckets.addOnLayoutChangeListener(this);
//    	mButtonReset.addOnLayoutChangeListener(this);
//    	mButtonBlank.addOnLayoutChangeListener(this);
//    	
//    }
//
//	@Override
//	public void onClick(View view) {
//		
//		switch (view.getId()) {
//		
//			case R.id.dashboard_income:
//				
//				Intent incomeStarter = new Intent(this, IncomeList.class);
//				this.startActivity(incomeStarter);
//				
//				break;
//				
//			case R.id.dashboard_expenses:
//				
////				Intent expenseStarter = new Intent(this, ExpenseFragmentController.class);
//				this.startActivity(expenseStarter);
//				
//				break;
//				
//			case R.id.dashboard_budgets:
//				
////				Intent bucketStarter = new Intent(this, BudgetFragmentController.class);
////				this.startActivity(bucketStarter);
//				
//				break;
//				
//			case R.id.dashboard_reset:
//				deleteDatabase(Provider.DatabaseHelper.DB_NAME);
//				
//				SharedPreferences.Editor prefs = getSharedPreferences(BudgetWidgetConfigure.PREFS_NAME, 0).edit();
//				prefs.clear();
//				prefs.commit();
//				
//				RemoteViews views = new RemoteViews(getPackageName(), R.layout.budget_widget);
//				AppWidgetManager appWidgetManager = AppWidgetManager.getInstance(this);
//								
//				int[] appWidgetIds = appWidgetManager.getAppWidgetIds(new ComponentName(this, BudgetWidget.class));
//				for (int appWidgetId : appWidgetIds) {				
//					Log.d(TAG, "Updating Widget #" + appWidgetId);
//					BudgetWidget.updateBucketWidget(this, appWidgetManager, appWidgetId);
//				}
//				
//				finish();
//				
//				break;
//			
//			case R.id.dashboard_blank:
//				
//				Intent s = new Intent(this, Overview.class);
//				this.startActivity(s);
//				
//				break;
//				
//			default:
//				return;
//		
//		}
//		
//	}
//
//	@Override
//	public void onLayoutChange(View view, int left, int top, int right, int bottom, int oldLeft, int oldTop, int oldRight, int oldBottom) {
//		int width = view.getWidth();
//		
//		((Button) view).setHeight(width);
//		
//	}
//	
//	@Override
//	public void onDestroy() {
//		super.onDestroy();
//		Log.d(TAG, "onDestroy");
//	}
//	
//	@Override
//	public void onPause() {
//		super.onPause();
//		Log.d(TAG, "onPause");
////		finish();
//	}
//	
//	@Override
//	public void onResume() {
//		super.onResume();
//		Log.d(TAG, "onResume");
//	}
//
//}
